package main

import (
	_ "github.com/jinzhu/gorm/dialects/mysql"
	"memo_project/dao"
	"memo_project/models"
	"memo_project/routers"
)

func main() {
	//连接mysql数据库
	err := dao.InitMysql()
	if err != nil {
		panic(err)
	}
	//创建数据库
	dao.DB.AutoMigrate(&models.Todo{})

	// 注册路由
	r := routers.SetupRouter()
	r.Run(":8090")
}
